# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo do
  @moduledoc """
  ResourceInfo represents the information/status of an app connector resource. Such as: - remote_agent - container - runtime - appgateway - appconnector - appconnection - tunnel - logagent

  ## Attributes

  *   `id` (*type:* `String.t`, *default:* `nil`) - Required. Unique Id for the resource.
  *   `resource` (*type:* `map()`, *default:* `nil`) - Specific details for the resource. This is for internal use only.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Overall health status. Overall status is derived based on the status of each sub level resources.
  *   `sub` (*type:* `list(GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo.t)`, *default:* `nil`) - List of Info for the sub level resources.
  *   `time` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp to collect the info. It is suggested to be set by the topmost level resource only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :id => String.t() | nil,
          :resource => map() | nil,
          :status => String.t() | nil,
          :sub =>
            list(
              GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo.t()
            )
            | nil,
          :time => DateTime.t() | nil
        }

  field(:id)
  field(:resource, type: :map)
  field(:status)

  field(:sub,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo,
    type: :list
  )

  field(:time, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ResourceInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
